// ==================================================================================
// Shared Genomics Project MPI Codebase
// Version 1.0 30/04/2010
//
// (c) 2010 University of Manchester all rights reserved
//
// This file is distributed under the GNU General Public License, Version 2.  
// Please see the file COPYING.txt for more details
// ==================================================================================

/*!
\file
\brief Implementation of Random Sleep 
*/

#include <windows.h>
#include <time.h>

#include "mt19937ar.h"
#include "random_sleep.h"

// Only works for windows at the moment which is okay.
void random_sleep(int min_milleseconds, int max_milleseconds) {
	long pause_millesec = min_milleseconds + (int) (abs(max_milleseconds-min_milleseconds) * genrand_real3());
	Sleep(pause_millesec);
}
